from django.db import models

#实验室和物理资产 1：*
#用户和物理资产 *：*
#用户和实验室1：*
# Create your models here.
class Lad (models.Model):
    l_name = models.CharField(max_length=32 ) #实验室名称
    floor = models.IntegerField() #楼层
    room = models.IntegerField()  #房间号
    l_people = models.CharField(max_length=32) #负责人


class Matter(models.Model):
    m_name = models.CharField(max_length=32) #物质名称
    desc = models.CharField(max_length=200) #描述
    number = models.IntegerField() #编号
    time = models.DateTimeField(auto_now_add=True)
    m_people = models.CharField(max_length=32)
    lad = models.ForeignKey('Lad',null=True)

class User (models.Model):
    u_name = models.CharField(max_length=32)
    password = models.CharField(max_length=32)
    name = models.CharField(max_length=32)
    phone = models.CharField(max_length=11)
    lad = models.ForeignKey('Lad',null=True)
    matter = models.ManyToManyField('Matter')